package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.SystemLog;
import cn.wolfcode.crm.mapper.SystemLogMapper;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.ISystemLogService;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemLogServiceImpl implements ISystemLogService {
    @Autowired
    private SystemLogMapper systemLogMapper;

    /**
     * 查看系统日志内容
     * author:张庆春
     * @param qo
     * @return
     */
    @Override
    public PageResult query(QueryObject qo) {
        Integer total = systemLogMapper.query4Count(qo);
        if(total==0){
            return PageResult.PAGERESULT_EMPTY;
        }
        return new PageResult(total,systemLogMapper.query4List(qo));
    }
}
